Skip to content

Conversation

@mariantrifu
Copy link

Q A
Branch? 4.2
Tickets Closes #7587 #7587
License MIT

API Platform library tries to extract the foreign_key from all relations, but BelongsToMany relations don't have a getForeignKeyName() method, so it returns null. When API Platform tries to flip an array containing null values, PHP throws the error: array_flip(): Can only flip string and integer values, entry skipped.

@mariantrifu mariantrifu changed the title fix(laravel): BelongsToMany relations dont have a getForeignKeyName() fix(laravel): belongs-to-many relations dont have a get-foreign-key-name method Dec 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant